package org.niu.listnode;

import java.util.HashMap;
import java.util.Map;

public class EntryNodeOfLoop {
    public ListNode EntryNodeOfLoop(ListNode pHead) {
        Map<ListNode,Integer> mp = new HashMap<>();
        while (pHead!=null){
            if(mp.get(pHead)!=null) return pHead;
            mp.put(pHead,1);
            pHead = pHead.next;
        }
        return null;
    }

    public static void main(String[] args) {
        String s = "three";
        System.out.println(s.indexOf("e"));
    }
}
